package demo.springcloud.nacos.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
@RefreshScope
public class HomeController {

    @Value("${test.title1}")
    private String title;
    @GetMapping("/")
    public ResponseEntity<String> index(){
        return new ResponseEntity<>(title, HttpStatus.OK);
    }
}
